<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>css渐变</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            float: left;
            width: 50px;
            height: 50px;
            font-size: 20px;
            line-height: 50px;
            text-align: center;
            margin: 20px auto auto 20px;
        }

        /* 参数说明（①控制渐变方式，②③（一个圆的圆心），④一个圆的半径，⑤⑥第二个圆的圆心，⑦第二个圆的半径  ⑧⑨开始的颜色，结束的颜色,从内到外） */
        .box-1 {
            background: -webkit-gradient(radial, 0 0, 0, 0 0, 0, from(rgb(60, 0, 255)), to(#804ec2));
        }

        .box-2 {
            background: -webkit-gradient(radial, 25 25, 0, 25 25, 25, from(#ffd4b2), to(#ffa861));
        }

        .box-3 {
            background: -webkit-gradient(radial, 25 25, 0, 25 25, 25, from(#c6fdae), to(#8afb59));
        }

        .box-4 {
            background: -webkit-gradient(radial, 25 25, 0, 25 25, 25, from(#f6fba5), to(#f5ff5b));
        }

        .box-5 {
            background: -webkit-gradient(radial, 25 25, 0, 25 25, 25, from(#feb3ad), to(#fd695d));
        }

        .box-6 {
            background: -webkit-gradient(radial, 25 25, 0, 25 25, 25, from(#fca8fd), to(#fd7aff));
        }

        .test {
            width: 200px;
            height: 100px;
            margin-top: 10px;
            border: 1px solid #ddd;
        }

        .test1 {
            background: linear-gradient(#fff, #333);
        }

        .test2 {
            background: linear-gradient(#000, #f00 50%, #090);
        }

        .test3 {
            background: linear-gradient(0deg, #000 20%, #f00 50%, #090 80%);
        }

        .test4 {
            background: linear-gradient(45deg, #f00 50%, #090);
        }

        .test5 {
            background: linear-gradient(to top right, #000, #f00 50%, #090);
        }
    </style>
</head>

<body>
    <!-- 放射性渐变（由内到外） -->
    <div class="box box-1"></div>
    <div class="box box-2">不</div>
    <div class="box box-3">住</div>
    <div class="box box-4">的</div>
    <div class="box box-5">海</div>
    <div class="box box-6">鲜</div>


    <!-- 线性渐变 -->
    <div class="test test1"></div>
    <div class="test test2"></div>
    <div class="test test3"></div>
    <div class="test test4"></div>
    <div class="test test5"></div>
</body>

</html>